from django.db import models
from utils.my_models import CoreMyModel


class ResourceConfig(CoreMyModel):
        
    arg_name = models.TextField(null=True, blank=True, max_length=255, verbose_name='参数名称', help_text='参数名称')
    arg_key = models.TextField(null=True, blank=True, max_length=255, verbose_name='参数键', help_text='参数键')
    arg_value = models.TextField(null=True, blank=True, max_length=4294967295, verbose_name='参数值', help_text='参数值')
    TYPE_CHOICES = (
        (1, "文本"),
        (2, "图片"),
        (3, "文件"),
        (4, "富文本"),
    )
    value_type = models.IntegerField(choices=TYPE_CHOICES, default=1, verbose_name="值类型", null=True, blank=True,
                                    help_text="值类型")
    sort = models.IntegerField(default=0, null=True, blank=True, verbose_name="显示排序", help_text="显示排序")
    remark = models.TextField(null=True, blank=True, max_length=1024, verbose_name='备注', help_text='备注')

    class Meta:
        db_table = 'tbl_resource_config'
        verbose_name = '资源字典'
        verbose_name_plural = verbose_name
        ordering = ('-create_time',)
    